#include "SimTKsimbody.h"
#include "Simbody.h"

using namespace SimTK;

class PeriodicEventReporter1 : public PeriodicEventReporter {
public:
    PeriodicEventReporter1(const MultibodySystem& system,   Real interval) :
        PeriodicEventReporter(interval), system(system) {
    }
    void handleEvent(const State& state) const {
        
		
		system.realize(state, Stage::Position);
		std::cout << system.getMatterSubsystem().getNumBodies();
        /*Vec3 pos = body.getBodyOriginLocation(state);
        std::cout<<state.getTime()<<"\t"<<pos[0]<<"\t"<<pos[1]<<std::endl;*/
    }
private:
    const MultibodySystem& system;
    //const MobilizedBody& body;
};